<?php

/**
 * Customer
 *  
 * @author tuanma
 * @version 
 */
require_once 'Zend/Db/Table/Abstract.php';
class Application_Model_DbTable_Customer extends Zend_Db_Table_Abstract {
	/**
	 * The default table name
	 */
	protected $_name = 'customer';
	
	protected $_primary = 'id';
	
	protected $_dependentTables = array('Application_Model_DbTable_Order', 'Application_Model_DbTable_WishList');
	
	function findByEmail($email) {
		$select = $this->select();
		$where1 = $this->getAdapter()->quoteInto("email = ?", $email);
		$where2 = $this->getAdapter()->quoteInto("del_flag = ?", 0);
		$select->where($where1);
		$select->where($where2);
		return $this->fetchRow($select);
	}
}
